package com.jast.business.service.impl;

import java.util.List;
import com.jast.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jast.business.mapper.BigdataYarnKvLineMapper;
import com.jast.business.domain.BigdataYarnKvLine;
import com.jast.business.service.IBigdataYarnKvLineService;
import com.jast.common.core.text.Convert;

/**
 * HDFS监控指标近3天指标Service业务层处理
 * 
 * @author Jast
 * @date 2023-02-14
 */
@Service
public class BigdataYarnKvLineServiceImpl implements IBigdataYarnKvLineService 
{
    @Autowired
    private BigdataYarnKvLineMapper bigdataYarnKvLineMapper;

    /**
     * 查询HDFS监控指标近3天指标
     * 
     * @param id HDFS监控指标近3天指标主键
     * @return HDFS监控指标近3天指标
     */
    @Override
    public BigdataYarnKvLine selectBigdataYarnKvLineById(Long id)
    {
        return bigdataYarnKvLineMapper.selectBigdataYarnKvLineById(id);
    }

    /**
     * 查询HDFS监控指标近3天指标列表
     * 
     * @param bigdataYarnKvLine HDFS监控指标近3天指标
     * @return HDFS监控指标近3天指标
     */
    @Override
    public List<BigdataYarnKvLine> selectBigdataYarnKvLineList(BigdataYarnKvLine bigdataYarnKvLine)
    {
        return bigdataYarnKvLineMapper.selectBigdataYarnKvLineList(bigdataYarnKvLine);
    }

    /**
     * 新增HDFS监控指标近3天指标
     * 
     * @param bigdataYarnKvLine HDFS监控指标近3天指标
     * @return 结果
     */
    @Override
    public int insertBigdataYarnKvLine(BigdataYarnKvLine bigdataYarnKvLine)
    {
        bigdataYarnKvLine.setCreateTime(DateUtils.getNowDate());
        return bigdataYarnKvLineMapper.insertBigdataYarnKvLine(bigdataYarnKvLine);
    }

    /**
     * 更新/新增HDFS监控指标近3天指标
     *
     * @param bigdataYarnKvLine HDFS监控指标近3天指标
     * @return 结果
     */
    @Override
    public int upsertBigdataYarnKvLine(BigdataYarnKvLine bigdataYarnKvLine)
    {
                bigdataYarnKvLine.setUpdateTime(DateUtils.getNowDate());
            return bigdataYarnKvLineMapper.upsertBigdataYarnKvLine(bigdataYarnKvLine);
    }

    /**
     * 修改HDFS监控指标近3天指标
     * 
     * @param bigdataYarnKvLine HDFS监控指标近3天指标
     * @return 结果
     */
    @Override
    public int updateBigdataYarnKvLine(BigdataYarnKvLine bigdataYarnKvLine)
    {
        bigdataYarnKvLine.setUpdateTime(DateUtils.getNowDate());
        return bigdataYarnKvLineMapper.updateBigdataYarnKvLine(bigdataYarnKvLine);
    }

    /**
     * 批量删除HDFS监控指标近3天指标
     * 
     * @param ids 需要删除的HDFS监控指标近3天指标主键
     * @return 结果
     */
    @Override
    public int deleteBigdataYarnKvLineByIds(String ids)
    {
        return bigdataYarnKvLineMapper.deleteBigdataYarnKvLineByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除HDFS监控指标近3天指标信息
     * 
     * @param id HDFS监控指标近3天指标主键
     * @return 结果
     */
    @Override
    public int deleteBigdataYarnKvLineById(Long id)
    {
        return bigdataYarnKvLineMapper.deleteBigdataYarnKvLineById(id);
    }
}
